package com.rongxun.hbwallet.mvp.presenter;

import android.content.Context;
import android.support.annotation.NonNull;

import com.rongxun.base.BaseObserver;
import com.rongxun.base.BasePresenter;
import com.rongxun.hbwallet.mvp.contract.IMenttionMeesage;

import io.reactivex.internal.observers.BasicFuseableObserver;

/**
 * 创建者     庄丰泽
 * 创建时间   2018/8/10 17:09
 * 描述
 */
public class MentionMessagePresenter extends BasePresenter<IMenttionMeesage.IView,IMenttionMeesage.IModel> implements IMenttionMeesage.IPresenter{
    public MentionMessagePresenter(@NonNull IMenttionMeesage.IView pUi, @NonNull IMenttionMeesage.IModel pModel) {
        super(pUi, pModel);
    }
    @Override
    public void getMentionMoneyMessage(double money_number, double Miners_fee) {
        getView().startMentionMessageDialog(money_number,Miners_fee);
    }

    @Override
    public void getConfig(String key_value) {
         addSubscribe(getModel().getConfig(key_value).subscribeWith(new BaseObserver<String>() {
             @Override
             public void onSuccess(String s, Context context) {
                 getView().setMiniMonney(s);
             }
         }));
    }
}
